package com.loong.nnm.controller;

import com.loong.nnm.entity.devm.NtpParameter;
import com.loong.nnm.services.DevmServices;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class DevmController {

    @Resource
    DevmServices devmServices;

    @RequestMapping("/node/{node}/ntp")
    public String setNtp(@PathVariable String node, @RequestBody NtpParameter ntpParameter) {
        return devmServices.configNtpServers(node, ntpParameter);
    }

    @GetMapping("/node/{node}/me")
    public String getMe(@PathVariable String node) {
        System.out.println(node);
        return devmServices.getMe(node);
    }


    @GetMapping("/node/{node}/eqs")
    public String getEqs(@PathVariable String node) {
        System.out.println(node);
        return devmServices.getEqs(node);
    }

    @GetMapping("/node/{node}/ptps")
    public String getPtps(@PathVariable String node) {
        System.out.println(node);
        return devmServices.getPtps(node);
    }

    @GetMapping("/node/{node}/ftps")
    public String getFtps(@PathVariable String node) {
        System.out.println(node);
        return devmServices.getFtps(node);
    }

    @GetMapping("/node/{node}/ctps")
    public String getCtps(@PathVariable String node) {
        System.out.println(node);
        return devmServices.getCtps(node);
    }



}
